<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/mobile/include/taglib.jsp"%>
<html>
<head>
	<title>送货员管理</title>
	<%@include file="/WEB-INF/views/mobile/include/head.jsp" %>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		
		//增加或删除
        function addOrDelMember(type){
        	if(type == 1){//删除
        		var id = $("input[name='rId']").val();
				window.location.href = "${ctx}/ivm/deliverymember/delete?id="+id+"&type="+${type};
        	}else{//新增
				window.location.href = "${ctx}/ivm/deliverymember/form?type"+${type};
        	}
		}
		
		//打开删除确认面板
		function checkDelete(id){
			$("#delPopup").popup("open");
			$("input[name='rId']").val(id);
		}
		
		//跳转到统计页面
		function goMemberStats(){
			window.location.href = "${ctx}/ivm/deliverymember/stats";
		}
	</script>
</head>
<body data-role="page">
	<div data-role="header" class="ui-header" data-position="fixed" data-tap-toggle="false">
		<div data-role="controlgroup" data-type="horizontal" class="ui-btn-left">
			<a href="${ctx }/ivm/deliverymember/stats"><img class="head-back-icon" src="${ctxFront}/images/head/android/back.png"/></a>
	    </div>
	    <h1>送货员管理</h1>
		<div data-role="controlgroup" data-type="horizontal" class="ui-mini ui-btn-right">
	        <a href="${ctx}/ivm/deliverymember/form?type=${type}" class="float-right"><img class="head-add-icon" src="${ctxFront}/images/head/android/add.png"/></a>
	    </div>
	</div>
	<div role="main" class="ui-content">
		<tags:mbmessage content="${message}"/>
		<c:if test="${page.count != 0}">
		<ul data-role="listview">
			<c:forEach items="${page.list}" var="deliverymember">
	        	<li class="ui-li-thumb" data-icon="false"><a href="${ctx}/ivm/deliverymember/form?id=${deliverymember.id}&type=${type}">${deliverymember.name}</a>
	        	<p class="ui-li-aside" style="margin-right:17%;top:12px;font-size:14px">
	        		${deliverymember.phone}
	        	</p>
	        	<p class="ui-li-aside" style="margin-right:-20px;">
	        		<img class="ui-li-del" onclick="checkDelete('${deliverymember.id}')" src="${ctxFront }/images/red_del.png"/>
	        	</p>
	        	</li>
	        </c:forEach>
	    </ul>
	    </c:if>
	    <c:if test="${page.count == 0}">
	    	暂无送货员.
	    </c:if>
		<div data-role="popup" id="delPopup" data-overlay-theme="b" data-theme="a" data-dismissible="false" style="max-width:400px;">
			<div data-role="header" data-theme="a">
		    	<h1>删除</h1>
		    </div>
		    <div role="main" class="ui-content">
		        <h3 class="ui-title">是否确定删除？</h3>
		        <input type="hidden" id="rId" name="rId" value=""/>
		        <a href="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-a" onclick="addOrDelMember(1)">确定</a>
		        <a href="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-a" data-rel="back">返回</a>
		    </div>
		</div>
	</div>
	<%@include file="/WEB-INF/views/mobile/layouts/menu.jsp" %>
</body>
</html>
